home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * Slave driver. wait for a request and carry it out.
- * Yossi Friedman, July 1988
- */
-
- #include <stdio.h>
- #include <gl.h>
- #include <math.h>
-
- #include "config.h"
- #include "newton.h"
-
- #ifdef MP
-
- void slave(void *arg)
- {
- int i = (int) arg;
- for (;;) {
- while (slave_func[i] == SLAVE_IDLE)
- ;
-
- switch (slave_func[i]) {
- case DO_CLEAR:
- do_clear(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case DO_ACCEL:
- do_accel(end_model_springs[i-1], end_model_springs[i], i);
- break;
-
- case DO_BOUNDS:
- do_bounds(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case DO_VEL_DAMP_POS:
- do_vel_damp_pos(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case DO_ROTATE_MODEL:
- do_rotate_model(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case DO_ROTATE_PHYSICS:
- do_rotate_physics(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case DRAW_FLAT_SURFS_1:
- draw_flat_surfs_1(end_model_surfs[i-1], end_model_surfs[i]);
- break;
-
- case DRAW_SMOOTH_SURFS_1:
- draw_smooth_surfs_1(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case DRAW_SMOOTH_SURFS_2:
- draw_smooth_surfs_2(end_model_surfs[i-1], end_model_surfs[i], i);
- break;
-
- case DRAW_SMOOTH_SURFS_3:
- draw_smooth_surfs_3(end_model_atoms[i-1], end_model_atoms[i]);
- break;
-
- case SLAVE_DIE:
- my_exit(0);
-
- default:
- fprintf(stderr, "newton: slave: Unidentified request (%d)\n", slave_func);
- break;
- }
-
- slave_func[i] = SLAVE_IDLE;
- }
- }
-
- #endif /* MP */
-